<style>
	.images{width:180px;float:left;margin-right:5px;margin-bottom:10px;}
	.images .image{width:144px;height:192px;border:1px #eee solid;margin:5px auto;background-repeat:no-repeat;background-origin:content-box;background-size:contain;background-position:center center;}
	.images .image a{padding:3px;text-align: right;border: 1px solid #eee; background: #ffffff;}
	.images textarea,.images input{width:100%;}
	.images textarea{height:100px;}
	.images .add{width:144px;height:192px;line-height: 192px;margin:5px auto;display: block;text-align: center;border: 1px solid #eee;}
</style>
<script>
var content_i=0;
function appendImages(replaceStr){
	return $($.parseHTML($('#images_new',navTab.getCurrentPanel()).text().replace(eval("/_new_/gi"),replaceStr), document, true)).appendTo($('#imagesBox',navTab.getCurrentPanel()));
}
function prependImages(replaceStr){
	return $($.parseHTML($('#images_new',navTab.getCurrentPanel()).text().replace(eval("/_new_/gi"),replaceStr), document, true)).prependTo($('#imagesBox',navTab.getCurrentPanel()));
}
<#if id?has_content>
$(function(){
<@_contentList parentId=id>
	<#if contentAttr??&&contentAttr.text?has_content>
		<#list contentAttr.text?eval as a>
	$temp=appendImages('_'+(content_i++)+'_');
	$('input',$temp).val('${(a.image?js_string)!}').trigger('change');
	$('textarea',$temp).val('${(a.description?js_string)!}');
	$temp.initUI();
		</#list>
	<#else>
		<#list page.list as a>
	$temp=appendImages('_'+(content_i++)+'_');
	$('input',$temp).val('${(a.cover?js_string)!}').trigger('change');
	$('textarea',$temp).val('${(a.description?js_string)!}');
	$temp.initUI();
		</#list>
	</#if>
</@_contentList>
});
</#if>
</script>
<#assign imagesHtml>
<div class="images">
	<div class="image">
		<a onclick="$(this).parent().parent().remove();return false;" href="javascript:;"><@t.m 'button.delete'/></a>
		<a href="file/upload.html?field=images_new_image" lookupGroup="" width="560" height="300" title="上传图片">上传</a>
	</div>
	<input type="hidden" name="images_new_image" onchange="$(this).parent().find('.image').css('background-image','url(${getUploadPath()}'+$(this).val()+')');"/>
	<textarea name="images_new_description" placeholder="描述" title="描述" ></textarea>
</div>
</#assign>
<textarea id="images_new" style="display:none">${imagesHtml?html}</textarea>
<dl class="nowrap">
	<dt>图集：</dt>
	<dd style="width:80%">
		<div class="images">
			<a class="add" href="javascript:;" onclick="prependImages('_new_'+(content_i++)+'_').initUI();return false;"><@t.m 'button.add'/></a>
		</div>
		<div id="imagesBox">
		</div>
	</dd>
</dl>